package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TBookCycleInfoMapper;
import com.ruoyi.system.domain.TBookCycleInfo;
import com.ruoyi.system.service.ITBookCycleInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 借书周期Service业务层处理
 * 
 * @author zhaowq
 * @date 2022-06-08
 */
@Service
public class TBookCycleInfoServiceImpl implements ITBookCycleInfoService 
{
    @Autowired
    private TBookCycleInfoMapper tBookCycleInfoMapper;

    /**
     * 查询借书周期
     * 
     * @param id 借书周期主键
     * @return 借书周期
     */
    @Override
    public TBookCycleInfo selectTBookCycleInfoById(Long id)
    {
        return tBookCycleInfoMapper.selectTBookCycleInfoById(id);
    }

    /**
     * 查询借书周期列表
     * 
     * @param tBookCycleInfo 借书周期
     * @return 借书周期
     */
    @Override
    public List<TBookCycleInfo> selectTBookCycleInfoList(TBookCycleInfo tBookCycleInfo)
    {
        return tBookCycleInfoMapper.selectTBookCycleInfoList(tBookCycleInfo);
    }

    /**
     * 新增借书周期
     * 
     * @param tBookCycleInfo 借书周期
     * @return 结果
     */
    @Override
    public int insertTBookCycleInfo(TBookCycleInfo tBookCycleInfo)
    {
        tBookCycleInfo.setCreateTime(DateUtils.getNowDate());
        return tBookCycleInfoMapper.insertTBookCycleInfo(tBookCycleInfo);
    }

    /**
     * 修改借书周期
     * 
     * @param tBookCycleInfo 借书周期
     * @return 结果
     */
    @Override
    public int updateTBookCycleInfo(TBookCycleInfo tBookCycleInfo)
    {
        tBookCycleInfo.setUpdateTime(DateUtils.getNowDate());
        return tBookCycleInfoMapper.updateTBookCycleInfo(tBookCycleInfo);
    }

    /**
     * 批量删除借书周期
     * 
     * @param ids 需要删除的借书周期主键
     * @return 结果
     */
    @Override
    public int deleteTBookCycleInfoByIds(String ids)
    {
        return tBookCycleInfoMapper.deleteTBookCycleInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除借书周期信息
     * 
     * @param id 借书周期主键
     * @return 结果
     */
    @Override
    public int deleteTBookCycleInfoById(Long id)
    {
        return tBookCycleInfoMapper.deleteTBookCycleInfoById(id);
    }
}
